<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>驾驶员考试预约系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description"
	content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
<meta name="author" content="Muhammad Usman">

<!-- The styles -->
<link
	href="<%=request.getContextPath()%>/resources/css/bootstrap-cerulean.min.css"
	rel="stylesheet">
<link
	href="<%=request.getContextPath()%>/resources/css/charisma-app.css"
	rel="stylesheet">
<link
	href='<%=request.getContextPath()%>/resources/bower_components/fullcalendar/dist/fullcalendar.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/fullcalendar/dist/fullcalendar.print.css'
	rel='stylesheet' media='print'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/chosen/chosen.min.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/colorbox/example3/colorbox.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/responsive-tables/responsive-tables.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/bower_components/bootstrap-tour/build/css/bootstrap-tour.min.css'
	rel='stylesheet'>
<link href='<%=request.getContextPath()%>/resources/css/jquery.noty.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/css/noty_theme_default.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/css/elfinder.min.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/css/elfinder.theme.css'
	rel='stylesheet'>
<link
	href='<%=request.getContextPath()%>/resources/css/jquery.iphone.toggle.css'
	rel='stylesheet'>
<link href='<%=request.getContextPath()%>/resources/css/uploadify.css'
	rel='stylesheet'>
<link href='<%=request.getContextPath()%>/resources/css/animate.min.css'
	rel='stylesheet'>

<!-- jQuery -->
<script
	src="<%=request.getContextPath()%>/resources/bower_components/jquery/jquery.min.js"></script>

<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

<!-- The fav icon -->
<link rel="shortcut icon"
	href="<%=request.getContextPath()%>/resources/img/favicon.ico">
<script type="text/javascript">
	function giveMarks(sid, ttid) {
		$("#giveMarksModal").find("input[name='sid']").val(sid);
		$("#giveMarksModal").find("input[name='ttid']").val(ttid);
		$("#giveMarksModal").modal("show");
	}
	function changeMarks(sid, ttid, marks) {
		$("#changeMarksModal").find("input[name='sid']").val(sid);
		$("#changeMarksModal").find("input[name='ttid']").val(ttid);
		$("#changeMarksModal").find("input[name='marks']").val(marks);
		$("#changeMarksModal").modal("show");
	}
	function cancleMarks(sid,ttid) {
		$("#deleteMarksForm").find("input[name='sid']").val(sid);
		$("#deleteMarksForm").find("input[name='ttid']").val(ttid);
		$("#deleteMarksForm").submit();
	}
</script>
</head>

<body>
	<jsp:include page="../toolbar.jsp"></jsp:include>
	<div class="ch-container">
		<div class="row">
			<jsp:include page="../nav.jsp"></jsp:include>
			<div id="content" class="col-lg-10 col-sm-10">
				<h3>我管辖的考生：</h3>
				<table class="table">
					<thead>
						<tr>
							<th>学生姓名</th>
							<th>身份证</th>
							<th>性别</th>
							<th>报考科目</th>
							<th>成绩</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${students }" var="s">
							<tr>

								<td>${s.name }</td>
								<td>${s.idCard }</td>
								<td>${s.sex }</td>
								<td>${s.testType }</td>
								<td><c:if test="${empty s.marks }">
										<a href="javascript:giveMarks('${s.sid }','${s.ttid }')">打分
										</a>
									</c:if> <c:if test="${!empty s.marks }">
										${s.marks } | <a
											href="javascript:changeMarks('${s.sid }','${s.ttid }','${s.marks }')">修改</a> | 
										<a href="javascript:cancleMarks('${s.sid }','${s.ttid }')">清除</a>
									</c:if></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
		</div>
		<jsp:include page="../foot.jsp"></jsp:include>
		<div class="modal fade" id="addTestTypeModal" tabindex="-1"
			role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<form action="<%=request.getContextPath()%>/student/addTestPlace"
						class="form-horizontal" role="form" method="post">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title" id="modal-title">添加考场</h4>
						</div>
						<div class="modal-body">
							<input name="smid" type="hidden" /> <input name="sid"
								type="hidden" />
							<div id="add-testType-form"></div>
							<p>
								<label>考试开始时间*</label> <input name="beginTime"
									class="form-control datetime" />
							</p>
							<p>
								<label>考试开始时间*</label> <input name="endTime"
									class="form-control datetime" />
							</p>
							<div class="modal-footer">
								<button type="button" class="btn btn-default"
									data-dismiss="modal">关闭</button>
								<button type="submit" class="btn btn-primary">添加考场</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>

		<div class="modal fade" id="giveMarksModal" tabindex="-1"
			role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<form action="<%=request.getContextPath()%>/teacher/giveMarks"
						class="form-horizontal" role="form" method="post">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title" id="modal-title">打分</h4>
						</div>
						<div class="modal-body">
							<input type="hidden" name="sid" /> <input type="hidden"
								name="ttid" /> <input type="number" name="marks"
								class="form-control" />
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							<button type="submit" class="btn btn-primary">打分</button>
						</div>
					</form>
				</div>
			</div>
		</div>
		<div class="modal fade" id="changeMarksModal" tabindex="-1"
			role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<form action="<%=request.getContextPath()%>/teacher/changeMarks"
						class="form-horizontal" role="form" method="post">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title" id="modal-title">打分</h4>
						</div>
						<div class="modal-body">
							<input type="hidden" name="sid" /> <input type="hidden"
								name="ttid" /> <input type="number" name="marks"
								class="form-control" />
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							<button type="submit" class="btn btn-primary">打分</button>
						</div>
					</form>
				</div>
			</div>
		</div>
		<form action="<%=request.getContextPath()%>/teacher/deleteMarks"
			method="post" id="deleteMarksForm" style="display: none">
			<input type="hidden" name="sid" /> <input type="hidden" name="ttid" />
		</form>
</body>
</html>
